import axios from "axios"

//创建一个axios实例(创建一个副本)
const requestMock = axios.create({
  baseURL: "",
  timeout: 10000,
  headers: {},
})

//配置请求拦截器
requestMock.interceptors.request.use(
  (config) => {
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)

//配置响应拦截器
requestMock.interceptors.response.use(
  (response) => {
    return response
  },
  (error) => {
    return Promise.reject(error)
  }
)

export default requestMock
